package com.cn.steam.iam.controller.open;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

import static com.cn.steam.foundation.common.model.CommonConstant.COMMON_OPEN_APIS_V1_PREFIX;

/**
 * 自定义token相关的接口
 * @author huangzz
 */
@RestController
@RequestMapping(COMMON_OPEN_APIS_V1_PREFIX + "/token")
public class IamTokenController {
//    @Autowired
//    private JwtTokenStore tokenStore;
//别删这个代码，有用
    @GetMapping("/user-info")
    public Principal getUserInfo(Principal principal) {
        return principal;
    }
//    @DeleteMapping
//    public void revokeToken(@RequestHeader(name = "Authorization") String bearerToken) {
//        String token = StringUtils.replace(bearerToken, IAM_OAUTH_BEARER_TOKEN_PREFIX, "");
//        tokenStore.removeAccessToken();
//    }
}
